/*
 * TaggedBrowseHistoryEntity.java
 *
 * Created on April 28, 2007, 6:54 PM
 *
 *  Life Logger v1.0
    Copyright (C) 2007  Anand Kishore (anand@semanticvoid.com)
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

package com.semanticvoid.lifelogger.entity;

import java.util.Arrays;
import java.util.Calendar;

/**
 * This class represents the subclass of BrowseHistory objects which have tags associated
 * with them. It extends the BrowseHistory entity.
 * @author anand kishore
 */
public class TaggedBrowseHistoryEntity extends BrowseHistoryEntity {
    
    /** The TAGS */
    private String[] tags;
    
    /**
     * Creates a new instance of TaggedBrowseHistoryEntity
     * @param guid the guid
     * @param link the link
     * @param pubDate the date
     * @param title the title
     * @param tags the tags
     * @param type the type (Bookmark OR ReadBlog)
     * @param searchContext the search context (will be null)
     * @param content the content
     */
    public TaggedBrowseHistoryEntity(String guid, String link, Calendar pubDate, String title, String[] tags, short type, String searchContext, String content) {
        super(guid, link, pubDate, title, type, searchContext, content);
        this.setTags(tags);
    }
    

    /**
     * Get the tags
     * @return the tags
     */
    public String[] getTags() {
        return tags;
    }

    /**
     * Set the tags
     * @param tags the tags
     */
    public void setTags(String[] tags) {
        this.tags = tags;
    }
    
    /**
     * Form the string representation of the object
     * @return the string representation of the object
     */
    public String toString() {
        return this.getGuid() + "#" + this.getType() + "#" + this.getPubDate().toString() + "#" + this.getSearchContext() + "#" + this.getTitle() + "#" + this.getLink() + "#" + Arrays.toString(this.tags);
    }
    
}
